<include file="Public/head" />
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.css" />
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
<script src="{:get_style_cdnurl()}paimai/yunying/js/city.js"></script>
<style>
    .xinxi-conter1 ul li .name-text{width:380px;border-left:none;}
    .xinxi-conter1 ul li em{border-left:solid 1px #e2e2e2;}
    .xinxi-conter1 ul li em:first-child{border-left:none;}
    .chexing {padding-left: 0px;}
    .chexing span{display: none;}
</style>
</head>
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar" menu="yhgz.mcyh" />
    <div class="mianR">
        <h3 class="yonghu">用户基本信息</h3>
        <div class="chezhu-xinxi">
            <div class="xinxi-conter xinxi-conter1">
                <h4>卖车用户ID: {$owner.owner_id}</h4>
                <ul>
                    <li>
                        <em>车主姓名</em>
                        <em class="name-text"><input type="text" id="seller_name" name="seller_name"  value="{$owner.seller_name}" placeholder="请输入车主姓名" /></em>
                    </li>
                    <li>
                        <em>车型</em>
                        <em class="name-text">
                            <input id="car_model" name="car_model" value="{$owner.car_model}" type="text" placeholder="车型"/>
                            <!--<script src="{:get_style_cdnurl()}paimai/cheshan/js/model_select.js" type="text/javascript"></script>-->
                            <!--<?php if(empty($owner['car_model'])):?>-->
                            <!--<?php else:?>-->
                                <!--<script>$(".chexing").hide();</script>-->
                                <!--{$owner.car_model}-->
                            <!--<?php endif;?>-->
                        </em>
                    </li>
                    <li>
                        <em>车辆所在地</em>
                        <em class="name-text">
                            <select id="location_area" name="location_area" class="branch_company" style="width: 130px;">
                                <if condition="count($bc_city) gt 1">
                                    <option value="0">请选择所在地</option>
                                </if>
                                <volist name="bc_city" id="city">
                                    <option value="{$key}">{$city}</option>
                                </volist>

                            </select>
                            <script>$("#location_area").val( <?php echo $owner['location_area']; ?> );</script>
                        </em>
                        <em>上牌时间</em>
                        <em class="name-text">
                            <input type="text" id="demoText2" name="first_reg_date" class="yongDi"  value="{$owner.first_reg_date}" placeholder="上牌时间" readonly />
                        </em>
                    </li>
                    <li>
                        <em>车主电话</em>
                        <em class="name-text">{$owner.phone}</em>
                        <em>行驶里程</em>
                        <em class="name-text">
                            <input id="mileage" type="text" name="mileage" class="yongLi" value="{$owner.mileage}" /><em>公里</em>
                        </em>
                    </li>
                    <li>
                        <em>提交时间</em>
                        <em class="name-text">{$owner.posttime}</em>
                        <em>渠道来源</em>
                        <em class="name-text">
                            <if condition="$owner.comefrom neq ''"><php>echo $show_from[$owner['comefrom']];</php><else/>未知</if>
                        </em>
                    </li>
                    <if condition="($owner.trace_type eq 1) OR ($owner.trace_type eq 2) OR ($owner.trace_type eq 3) ">
                        <li>
                            <em >预约地址</em>
                            <em class="name-text">{$owner.reserve_addr}</em>
                        </li>
                    </if>
                    <?php if($owner['trace_type']>0):?>
                    <li>
                        <em style="color: #1f1f1f; font-weight: bolder;"><?php echo C('TRACE_TYPE.'.$owner['trace_type']); ?>原因</em>
                        <em class="name-text" style="color: #cd0a0a;font-weight: bolder;">{$owner.remark_fail}</em>
                    </li>
                    <?php endif;?>
                    <?php if($owner['trace_type']==3 && $owner['delay_status']==5):?>
                    <li>
                        <em>预约提醒</em>
                        <em class="name-text">{$owner.reserve_reminder}</em>
                    </li>
                    <?php endif;?>
                </ul>
            </div>
        </div>
        <h3 class="yonghu">系统跟踪日志</h3>
        <div class="yonghuText">
            <ul>
                <volist name="logs" id="log" key="k">
                    <li class="{$k%2==0?'xitongBg':''} clearfix">
                        <em class="huShi">{$log.createtime}</em>
                        <em>
                            <?php if($log['type']<5):?>
                                客服
                            <?php elseif($log['type'] == 5 || $log['type'] == 6 || $log['type'] == 7):?>
                                调度
                            <?php else:?>
                                评估师
                            <?php endif;?>
                        </em>
                        <em>{$log.real_name}</em>
                        <em>{$log_type[$log['type']]}</em>
                        <em class="huShi">{$log.remark}</em>
                    </li>
                </volist>
            </ul>
        </div>
        <h3 class="yonghu">请选择预约结果</h3>
        <div class="yuyue">
            <ul>
                <?php if($owner['trace_type']!=3 || ($owner['trace_type']==3 && $owner['delay_status']==5)):?>
                <li class="yuCurrent" onclick="setStatus(4);">预约成功</li>
                <li onclick="setStatus(2);" >继续跟踪</li>
                <input type="hidden" id="business_status" name="business_status" value="4" />
                <?php else:?>
                <li class="yuCurrent" onclick="setStatus(-1);" >同意等待</li>
                <li  onclick="setStatus(2);" >继续跟踪</li>
                <input type="hidden" id="business_status" name="business_status" value="-1" />
                <?php endif;?>
                <li onclick="setStatus(3);">预约失败</li>                    
            </ul>
        </div>
        <div class="listBox">
            <?php if($owner['trace_type']!=3  || ($owner['trace_type']==3 && $owner['delay_status']==5)):?>
            <div class="yuList">
                <div class="xuanzhe">
                    <ul>
                        <li class="clearfix">
                            <span>预约时间</span>
                            <input type="text" value="" id="reserve_time" class="xiaci"  placeholder="请选择预约时间" readonly />
                        </li>
                        <li class="clearfix">
                            <span>服务方式</span>
                            <span class="menDao">
                                <a href="javascript:setMethod(2);" class="menHover">上门</a>
                                <a href="javascript:setMethod(3);">到店</a>
                            </span>
                            <input type="hidden" id="service_method" name="service_method"  value="2"/>
                        </li>
                        <li class="clearfix">
                            <span>预约地址</span>
                            <div class="store">
                                <div class="detailed" style="display:block;">
                                    <script>var addr = new AddressCom("reserve");</script>
                                    <input id="reserve_address" name="reserve_address" type="text" value="" placeholder="详细地址" class="xiangDi" />
                                </div>
                                <div class="detailed" style="display:none;">
                                    <select id="reserve_store" name="reserve_store" >
                                        <option value="0" >请选择门店</option>
                                        <?php foreach($stores as $k=>$store):?>
                                        <option value="{$k}">{$store}</option>
                                        <?php endforeach;?>
                                    </select>
                                </div>

                            </div>
                        </li>
                        <li class="clearfix">
                            <span>备注</span>
                            <textarea id="reserve_remark1" class="remark" name="reserve_remark1" ></textarea>
                        </li>
                    </ul>
                </div>
                <div class="yongBtn1">
                    <input class="submitForm queding" type="button" value="确定" />
                </div>
            </div>
            <div class="yuList" style="display: none;">
                <div class="xuanzhe1">
                    <ul>
                        <li class="genBtn1 clearfix">
                            <span class="gencuur"><font>电话无人接听</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>电话停机或关机</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>最近没时间</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>直接挂断电话</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>需要了解二手车拍卖</font><input type="checkbox" /></span>
                        </li>
                        <li class="clearfix">
                            <span>其他原因</span>
                            <textarea id="trace_remark" class="remark" name="trace_remark" ></textarea>
                        </li>
                        <li class="clearfix">
                            <span>下次跟踪时间</span>
                            <input type="text" value="" id="demoText10" class="xiaci" placeholder="请选择下次跟踪时间" readonly />
                        </li>
                    </ul>
                </div>
                <div class="yongBtn">
                    <input class="submitForm queding" type="button" value="确定"  />
                </div>
            </div>
            <?php else:?>
            <div class="yuList">
                <div class="xuanzhe1">
                    <ul>
                        <li class="clearfix">
                            <span>备注</span>
                            <textarea  class="remark"></textarea>
                        </li>
                    </ul>
                </div>
                </form>
                <div class="yongBtn1">
                    <input class="submitForm queding" type="button"  value="确定" />
                </div>
            </div>
            <div class="yuList" style="display: none;">
                <div class="xuanzhe1">
                    <ul>
                        <li class="genBtn1 clearfix">
                            <span class="gencuur"><font>电话无人接听</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>电话停机或关机</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>最近没时间</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>直接挂断电话</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>需要了解二手车拍卖</font><input type="checkbox" /></span>
                        </li>
                        <li class="clearfix">
                            <span>其他原因</span>
                            <textarea id="trace_remark" class="remark" name="trace_remark" ></textarea>
                        </li>
                        <li class="clearfix">
                            <span>下次跟踪时间</span>
                            <input type="text" value="" id="demoText10" class="xiaci" placeholder="请选择下次跟踪时间" readonly />
                        </li>
                    </ul>
                </div>
                <div class="yongBtn">
                    <input class="submitForm queding" type="button" value="确定"  />
                </div>
            </div>
            <?php endif;?>
            <div class="yuList" style="display:none;">
                <div class="xuanzhe1">
                    <ul>
                        <li class="genBtn1 clearfix">
                            <span class="gencuur" ><font>价格不满意</font><input type="checkbox" /></span>
                            <span class="gencuur" ><font>不想卖了</font><input type="checkbox" /></span>
                            <span class="gencuur" ><font>无法过户</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>车已出售</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>对服务不满意</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>非经营范围</font><input type="checkbox" /></span>
                            <span class="gencuur"><font>超出检测范围</font><input type="checkbox" /></span>
                        </li>
                        <li class="clearfix">
                            <span>其他原因</span>
                            <textarea id="faild_remark" class="remark" name="faild_remark"></textarea>
                        </li>
                    </ul>
                    <input type="hidden" id="reserve_remark" name="reserve_remark" value="">
                </div>
                </form>
                <div class="yongBtn1">
                    <input class="submitForm queding" type="button"  value="确定" />
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        $("#reserve_time").ymdateplugin({
            showTimePanel: true,
            changeMonth: true,
            changeYear: true,
            gotoCurrent: true,
            ampm:true
        });
    });
    $("#location_area,#reserve_store").select2();

    function setMethod(m) {
        $("#service_method").val(m);
    }

    function setStatus(status) {
        $("#business_status").val(status);
    }

    //ModelSelect.set_init([{$owner.brand_id}, {$owner.series_id}, {$owner.model_id}]); //初始化

    $(".genBtn1 input").click(function () {
        if ($(this).parent().hasClass("gencuur")) {
            $("#reserve_remark").val($(this).parent().find("font").text());
        } else {
            $("#reserve_remark").val('');
        }
    })

    $(".remark").blur(function () {
        var remark = $(this).val();
        if (remark != '') {
            $("#reserve_remark").val(remark);
        }
    });
    $(".submitForm").click(function () {
        var post_data = {};
        post_data['owner_id'] = "{$owner.owner_id}";
        post_data['seller_name'] = $("#seller_name").val();
        post_data['phone'] = "{$owner.phone}";
        post_data['location_area'] = $("#location_area").val();
        post_data['first_reg_date'] = $("#demoText2").val();
        post_data['mileage'] = $("#mileage").val();
        post_data['service_method'] = $("#service_method").val();
        post_data['business_status'] = $("#business_status").val();
        post_data['reserve_province'] = $("input[name='province_reserve']").val();
        post_data['reserve_city'] = $("input[name='city_reserve']").val();
        post_data['reserve_area'] = $("input[name='area_reserve']").val();
        post_data['reserve_address'] = $("#reserve_address").val();
        post_data['reserve_store'] = $("#reserve_store").val();
        post_data['reserve_time'] = $("#reserve_time").val();
        post_data['next_trace_time'] = $("#demoText10").val();
        post_data['reserve_remark'] = $("#reserve_remark").val();

        $(".yunBei").css("display",'block').unbind('click');
        $(".loading").fadeIn();
        post_data['car_model'] = $("#car_model").val();
        $.post("/CarOwner/upCarOwner", post_data, function (data) {
            if (data.code != 200) {
                shibai_alert(data.msg, 1500);
                $(".loading").fadeOut();
                $(".yunBei").css("display",'none');
                return false;
            }
            btn_alert(data.msg, 1500, function () {
                location.href = document.referrer
            });
        }, "json");
    });

</script>
<include file="Public/foot" />